package com.lljjcoder.citypickerview.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class ProvinceModel implements Parcelable {
	private String name;
	private ArrayList<CityModel> cityList;
	
	public ProvinceModel() {
		super();
	}

	public ProvinceModel(String name, ArrayList<CityModel> cityList) {
		super();
		this.name = name;
		this.cityList = cityList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ArrayList<CityModel> getCityList() {
		return cityList;
	}

	public void setCityList(ArrayList<CityModel> cityList) {
		this.cityList = cityList;
	}

	@Override
	public String toString() {
		return "ProvinceModel [name=" + name + ", cityList=" + cityList + "]";
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.name);
		dest.writeTypedList(this.cityList);
	}

	protected ProvinceModel(Parcel in) {
		this.name = in.readString();
		this.cityList = in.createTypedArrayList(CityModel.CREATOR);
	}

	public static final Parcelable.Creator<ProvinceModel> CREATOR = new Parcelable.Creator<ProvinceModel>() {
		@Override
		public ProvinceModel createFromParcel(Parcel source) {
			return new ProvinceModel(source);
		}

		@Override
		public ProvinceModel[] newArray(int size) {
			return new ProvinceModel[size];
		}
	};
}
